.class public Lcom/zuiapps/sdk/analytics/db/NaturalOrderComparator;
.super Ljava/lang/Object;
.source "NaturalOrderComparator.java"

# interfaces
.implements Ljava/util/Comparator;


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "Ljava/lang/Object;",
        "Ljava/util/Comparator",
        "<",
        "Ljava/lang/Object;",
        ">;"
    }
.end annotation


# direct methods
.method public constructor <init>()V
    .registers 1

    .prologue
    .line 29
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method static charAt(Ljava/lang/String;I)C
    .registers 3
    .param p0, "s"    # Ljava/lang/String;
    .param p1, "i"    # I

    .prologue
    .line 126
    invoke-virtual {p0}, Ljava/lang/String;->length()I

    move-result v0

    if-lt p1, v0, :cond_8

    .line 127
    const/4 v0, 0x0

    .line 129
    :goto_7
    return v0

    :cond_8
    invoke-virtual {p0, p1}, Ljava/lang/String;->charAt(I)C

    move-result v0

    goto :goto_7
.end method


# virtual methods
.method public compare(Ljava/lang/Object;Ljava/lang/Object;)I
    .registers 15
    .param p1, "o1"    # Ljava/lang/Object;
    .param p2, "o2"    # Ljava/lang/Object;

    .prologue
    const/16 v11, 0x30

    .line 63
    invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v0

    .line 64
    .local v0, "a":Ljava/lang/String;
    invoke-virtual {p2}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v1

    .line 66
    .local v1, "b":Ljava/lang/String;
    const/4 v4, 0x0

    .local v4, "ia":I
    const/4 v5, 0x0

    .line 67
    .local v5, "ib":I
    const/4 v6, 0x0

    .local v6, "nza":I
    const/4 v7, 0x0

    .line 73
    .local v7, "nzb":I
    :goto_e
    const/4 v7, 0x0

    move v6, v7

    .line 75
    invoke-static {v0, v4}, Lcom/zuiapps/sdk/analytics/db/NaturalOrderComparator;->charAt(Ljava/lang/String;I)C

    move-result v2

    .line 76
    .local v2, "ca":C
    invoke-static {v1, v5}, Lcom/zuiapps/sdk/analytics/db/NaturalOrderComparator;->charAt(Ljava/lang/String;I)C

    move-result v3

    .line 79
    .local v3, "cb":C
    :goto_18
    invoke-static {v2}, Ljava/lang/Character;->isSpaceChar(C)Z

    move-result v9

    if-nez v9, :cond_20

    if-ne v2, v11, :cond_2d

    .line 80
    :cond_20
    if-ne v2, v11, :cond_2b

    .line 81
    add-int/lit8 v6, v6, 0x1

    .line 87
    :goto_24
    add-int/lit8 v4, v4, 0x1

    invoke-static {v0, v4}, Lcom/zuiapps/sdk/analytics/db/NaturalOrderComparator;->charAt(Ljava/lang/String;I)C

    move-result v2

    goto :goto_18

    .line 84
    :cond_2b
    const/4 v6, 0x0

    goto :goto_24

    .line 90
    :cond_2d
    :goto_2d
    invoke-static {v3}, Ljava/lang/Character;->isSpaceChar(C)Z

    move-result v9

    if-nez v9, :cond_35

    if-ne v3, v11, :cond_42

    .line 91
    :cond_35
    if-ne v3, v11, :cond_40

    .line 92
    add-int/lit8 v7, v7, 0x1

    .line 98
    :goto_39
    add-int/lit8 v5, v5, 0x1

    invoke-static {v1, v5}, Lcom/zuiapps/sdk/analytics/db/NaturalOrderComparator;->charAt(Ljava/lang/String;I)C

    move-result v3

    goto :goto_2d

    .line 95
    :cond_40
    const/4 v7, 0x0

    goto :goto_39

    .line 102
    :cond_42
    invoke-static {v2}, Ljava/lang/Character;->isDigit(C)Z

    move-result v9

    if-eqz v9, :cond_5d

    invoke-static {v3}, Ljava/lang/Character;->isDigit(C)Z

    move-result v9

    if-eqz v9, :cond_5d

    .line 103
    invoke-virtual {v0, v4}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object v9

    invoke-virtual {v1, v5}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object v10

    invoke-virtual {p0, v9, v10}, Lcom/zuiapps/sdk/analytics/db/NaturalOrderComparator;->compareRight(Ljava/lang/String;Ljava/lang/String;)I

    move-result v8

    .local v8, "result":I
    if-eqz v8, :cond_5d

    .line 117
    .end local v8    # "result":I
    :goto_5c
    return v8

    .line 108
    :cond_5d
    if-nez v2, :cond_64

    if-nez v3, :cond_64

    .line 111
    sub-int v8, v6, v7

    goto :goto_5c

    .line 114
    :cond_64
    if-ge v2, v3, :cond_68

    .line 115
    const/4 v8, -0x1

    goto :goto_5c

    .line 116
    :cond_68
    if-le v2, v3, :cond_6c

    .line 117
    const/4 v8, 0x1

    goto :goto_5c

    .line 120
    :cond_6c
    add-int/lit8 v4, v4, 0x1

    .line 121
    add-int/lit8 v5, v5, 0x1

    goto :goto_e
.end method

.method compareRight(Ljava/lang/String;Ljava/lang/String;)I
    .registers 9
    .param p1, "a"    # Ljava/lang/String;
    .param p2, "b"    # Ljava/lang/String;

    .prologue
    .line 31
    const/4 v0, 0x0

    .line 32
    .local v0, "bias":I
    const/4 v3, 0x0

    .line 33
    .local v3, "ia":I
    const/4 v4, 0x0

    .line 40
    .local v4, "ib":I
    :goto_3
    invoke-static {p1, v3}, Lcom/zuiapps/sdk/analytics/db/NaturalOrderComparator;->charAt(Ljava/lang/String;I)C

    move-result v1

    .line 41
    .local v1, "ca":C
    invoke-static {p2, v4}, Lcom/zuiapps/sdk/analytics/db/NaturalOrderComparator;->charAt(Ljava/lang/String;I)C

    move-result v2

    .line 43
    .local v2, "cb":C
    invoke-static {v1}, Ljava/lang/Character;->isDigit(C)Z

    move-result v5

    if-nez v5, :cond_18

    invoke-static {v2}, Ljava/lang/Character;->isDigit(C)Z

    move-result v5

    if-nez v5, :cond_18

    .line 57
    .end local v0    # "bias":I
    :goto_17
    return v0

    .line 45
    .restart local v0    # "bias":I
    :cond_18
    invoke-static {v1}, Ljava/lang/Character;->isDigit(C)Z

    move-result v5

    if-nez v5, :cond_20

    .line 46
    const/4 v0, -0x1

    goto :goto_17

    .line 47
    :cond_20
    invoke-static {v2}, Ljava/lang/Character;->isDigit(C)Z

    move-result v5

    if-nez v5, :cond_28

    .line 48
    const/4 v0, 0x1

    goto :goto_17

    .line 49
    :cond_28
    if-ge v1, v2, :cond_32

    .line 50
    if-nez v0, :cond_2d

    .line 51
    const/4 v0, -0x1

    .line 39
    :cond_2d
    :goto_2d
    add-int/lit8 v3, v3, 0x1

    add-int/lit8 v4, v4, 0x1

    goto :goto_3

    .line 53
    :cond_32
    if-le v1, v2, :cond_38

    .line 54
    if-nez v0, :cond_2d

    .line 55
    const/4 v0, 0x1

    goto :goto_2d

    .line 56
    :cond_38
    if-nez v1, :cond_2d

    if-nez v2, :cond_2d

    goto :goto_17
.end method
